<a href="#/layui/fenhuiguanli" class="layui-btn layui-btn-xs layui-btn-primary" style="margin: 20px 0 0 30px;">
  <i class="layui-icon">&#xe65c;</i>
</a>

<h2 class="title">分会会员列表</h2> 

<div class="layui-card-body">
          <div class="layui-card-header">
            <!-- <span>所有会员列表</span> -->
            <a href="#/layui/fenhuiCheckList" class="layui-btn layui-btn-xs layui-btn-primary">
              <i class="layui-icon">&#xe60a;</i>
              <span>审核</span>
            </a>
            <a href="#/member/all/edit" class="layui-btn layui-btn-xs layui-btn-danger">
              <i class="layui-icon">&#xe640;</i>
              <span>批量删除</span>
            </a>
            <a href="#/member/all/edit" class="layui-btn layui-btn-xs layui-btn-primary">
              <i class="layui-icon">&#xe62f;</i>
              <span>导出到Excel</span>
            </a>
            <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary" id="search_hash">
              <i class="layui-icon">&#xe615;</i>
            </a>
          </div>
          <div class="layui-card-body">
            <table id="demo_hash" lay-filter="test"></table>
            <script type="text/html" id="barDemo_hash">
              <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
              <!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> -->
              <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            </script>
          </div>
        </div>
      
      
      
      
      </div>
    </div>
  </div>
</div>

<script type="text/html" id="search_tpl_hash">
  <form class="layui-form" action="">
    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-block">
        <input type="text" name="title" placeholder="请输入用户名.." autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">会员ID</label>
      <div class="layui-input-block">
        <input type="text" name="title" placeholder="" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">会员姓名</label>
      <div class="layui-input-block">
        <input type="text" name="title" placeholder="" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">联系电话</label>
      <div class="layui-input-block">
        <input type="text" name="title" placeholder="" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">会员等级</label>
      <div class="layui-input-block">
        <select name="city">
          <option value="0">全部</option>
          <option value="1">初学者</option>
          <option value="2">VIP</option>
          <option value="3">院长</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="formDemo_hash"><i class="layui-icon">&#xe615;</i> 搜索</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
  </form>
</script>

<script>
  layui.config({
    base: '/src/js/'
  }).use(['jquery', 'mockjs', 'table', 'sidebar', 'form','route'], function () {
    var $ = layui.jquery,
      layer = layui.layer,
      table = layui.table,
      sidebar = layui.sidebar,
      route = layui.route,
      params = route.params(),
      form = layui.form;
      
    // 注入mock
    layui.mockjs.inject({
      'POST /demo/table/user': {
        code: 0,
        msg: "xxx",
        count: 1000,
        'data|20': [{
          'id|+1': 1,
          username: '@name',
          sex: '@boolean',
          city: '@city',
          sign: '@csentence',
          experience: '@integer',
          score: '@integer',
          classify: '@word',
          wealth: '@integer',
          auth: '@boolean'
        }]
      }
    });
    //第一个实例
    table.render({
      method: 'post',
      // size: 'sm',
      limit: 10,
      limits: [10,20,30],
      elem: '#demo_hash',
      height: 'full-235',
      url: 'https://xnsmb.xnsoft.net.cn/api/Filtrate_Xn_CircleMember', //数据接口
      page: true, //开启分页
      contentType: 'application/json',
      where: {
      	"CircleGuid": params.id,
			  "MemLoginId": "",
			  "RealName": "",
			  "Mobile": ""
      },
      request: {
			    pageName: 'CurrentPage' //页码的参数名称，默认：page
			    ,limitName: 'PageSize' //每页数据量的参数名，默认：limit
			  },
      parseData: function(res){
      	return {
      		'code':0,
      		'count':res.CountPage,
      		"data":res._Data
      	};
      },
      cols: [
        [ //表头
          {
//          field: 'id',
//          title: 'ID',
            width: 200,
            sort: true,
            fixed: 'left',
            type: 'checkbox'
          }, {
            field: 'MemLoginId',
            title: '会员ID',
            width: 200
          }, {
            field: 'RealName',
            title: '会员名称',
            width: 200,
            sort: true
          }, {
            field: 'Mobile',
            title: '会员手机号',
            width: 200
          }, {
            field: '',
            title: '所加入分会',
            width: 177
          }, {
            field: '',
            title: '申请时间',
            width: 200,
            sort: true
          }
        ]
      ]
    });

    $('#search_hash').on('click', function () {
      var that = this;
      // console.log($('#search_tpl_hash').html());
      sidebar.render({
        elem: that,
        content: $('#search_tpl_hash').html(),
        title: '搜索',
        shade: true,
        // shadeClose:false,
        // direction: 'left'
        // dynamicRender: false,
        // url: 'views/member/all/search.html',
        width: '500px', //可以设置百分比和px
        done: function () {
          console.log('ccc');
          form.render();

          //监听提交
          form.on('submit(formDemo_hash)', function (data) {
            // layer.msg(JSON.stringify(data.field));
            table.reload('demo_hash', {
              where: data.field
            });
            return false;
          });
        }
      });
    });
    
    DBHelper.Post("Filtrate_Xn_CircleMember",{
    	"CircleGuid": params.id,
		  "MemLoginId": "s",
		  "RealName": "",
		  "Mobile": "",
		  "CurrentPage": 1,
		  "PageSize": 10
    },function(data){
    	console.log(data)
    },function(data){
    	console.log(data)
    })
    
    
  });
</script>





	<style scoped>
      	.title{
      		margin-left: 30px;
      		margin-top: 30px;
      	}
      	.checkBtn{
      		border-radius: 5px;
      		width: 100px;
      	}
      	.listBtns{
      		display: flex;
      		justify-content: space-between;
      		width: 100%;
      	}
      	.listBtn{
      		border-radius: 5px;
      	}
      	.FHDetail-table tr>th{
      		text-align: center;
      	}
      	.FHDetail-table tr>td{
      		text-align: center;
      	}
      	
      	
      </style>
      
      
